有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java发生JNI错误(jdeveloper12c)

我正在尝试构建一个使用外部库的Java桌面应用程序

该项目在ide jdeveloper 12c中运行良好,但当我进行部署时,我会看到

Error: A JNI error has occurred, Please chack your installation and try agan. Exception in thread "main" java.lang.NoClassDefFoundError: orf / icepdf / core ..

我在项目^{中插入并创建部署

我还尝试在项目properties -> Deployment -> Profile Tupe: JAR File -> Main Class: My class -> File Groups -> New Libraries中创建部署,但在这两种情况下都出现了错误

编辑:错误附近的代码:

public static void setup() throws IOException {
    JFrame frame = new JFrame("PDF Test");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    PagePanel panel = new PagePanel(); frame.add(panel);
    frame.pack(); 
    frame.setVisible(true);

    File file = new File("c://test.pdf"); 
    RandomAccessFile raf = new RandomAccessFile(file, "r");
    FileChannel channel = raf.getChannel(); 
    ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
    PDFFile pdffile = new PDFFile(buf);

    PDFPage page = pdffile.getPage(0);
    panel.setClip(null);              
    panel.useZoomTool(true);
    panel.showPage(page);
}

错误:

C:\JDeveloper\mywork\borrar4\Client\deploy>java -jar archive3.jar
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/p
dfview/PDFPage
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getDeclaredMethod(Unknown Source)
        at java.awt.Component.isCoalesceEventsOverriden(Unknown Source)
        at java.awt.Component.access$500(Unknown Source)
        at java.awt.Component$3.run(Unknown Source)
        at java.awt.Component$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Component.checkCoalescing(Unknown Source)
        at java.awt.Component.<init>(Unknown Source)
        at java.awt.Container.<init>(Unknown Source)
        at javax.swing.JComponent.<init>(Unknown Source)
        at javax.swing.JPanel.<init>(Unknown Source)
        at javax.swing.JPanel.<init>(Unknown Source)
        at javax.swing.JPanel.<init>(Unknown Source)
        at client.PagePanel.<init>(PagePanel.java:77)
        at client.VerPdfSimplePage.setup(VerPdfSimplePage.java:29)
        at client.VerPdfSimplePage$1.run(VerPdfSimplePage.java:57)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
        at java.awt.EventQueue.access$500(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.awt.EventQueue$3.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.sun.pdfview.PDFPage
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 32 more

C:\JDeveloper\mywork\borrar4\Client\deploy>

在JDeveloper IDE 12c中,问题是开发部署。当我通过CMD运行生成的jar时,控制台给出了错误信息。有了jdeveloper 11,我可以选择在jdeveloper 12c中开发“依赖性分析”的部署,但我找不到这个选项


共 (0) 个答案